package com.secondary.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.secondary.dao.main.CategoryDao;
import com.secondary.pojos.Category;

@Service
public class CategoryService {
	@Resource
	private CategoryDao categoryDao;
	
	public List findParentCategory(int id) {
		
		List<Category> list=categoryDao.findCategoriesByParentId(id);
		
		return list;
	}
	public Category findParentCategoryObject(int id){
		return (Category)categoryDao.findObject(Category.class, id);
	}
	public CategoryDao getCategory() {
		return categoryDao;
	}
	public void setCategory(CategoryDao category) {
		this.categoryDao = category;
	}
	
}
